<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

<ui:composition
	template="/WEB-INF/facelets/templates/templateAdministrador.xhtml">
	<ui:define name="content">
		<h:form>
			<h:panelGrid columns="3">
				<h:outputText value="Inicio de Preinscripción" />
				<rich:calendar
					value="#{convocatoriaBean.convocatoriaSeleccionada.inicioPreinscripcion}"
					required="true" requiredMessage="Dato requerido" id="inicioPreins">
					<rich:ajaxValidator event="onblur" />
				</rich:calendar>
				<rich:message for="inicioPreins" style="color:red;">
					<f:facet name="errorMarker">
						<h:graphicImage value="/images/icons/error.jpg" />
					</f:facet>
				</rich:message>

				<h:outputText value="Fin de Preinscripción" />
				<rich:calendar
					value="#{convocatoriaBean.convocatoriaSeleccionada.finPreinscripcion}"
					required="true" requiredMessage="Dato requerido" id="finPreins">
					<rich:ajaxValidator event="onblur" />
				</rich:calendar>
				<rich:message for="finPreins" style="color:red;">
					<f:facet name="errorMarker">
						<h:graphicImage value="/images/icons/error.jpg" />
					</f:facet>
				</rich:message>

				<h:outputText value="Inicio de recepción de propuestas" />
				<rich:calendar
					value="#{convocatoriaBean.convocatoriaSeleccionada.inicioPropuesta}"
					required="true" requiredMessage="Dato requerido" id="inicioProp">
					<rich:ajaxValidator event="onblur" />
				</rich:calendar>
				<rich:message for="inicioProp" style="color:red;">
					<f:facet name="errorMarker">
						<h:graphicImage value="/images/icons/error.jpg" />
					</f:facet>
				</rich:message>

				<h:outputText value="Fin de recepción de propuestas" />
				<rich:calendar
					value="#{convocatoriaBean.convocatoriaSeleccionada.finPropuesta}"
					required="true" requiredMessage="Dato requerido" id="finProp">
					<rich:ajaxValidator event="onblur" />
				</rich:calendar>
				<rich:message for="finProp" style="color:red;">
					<f:facet name="errorMarker">
						<h:graphicImage value="/images/icons/error.jpg" />
					</f:facet>
				</rich:message>
				
				<h:outputText value="Estado" />
				<rich:comboBox value="#{convocatoriaBean.estado}"
					defaultLabel="Activa" width="130" enableManualInput="false">
					<a4j:support event="onchange" reRender="tabla" />
					<f:selectItem itemLabel="1" itemValue="Activa" />
					<f:selectItem itemLabel="0" itemValue="Inactiva" />
				</rich:comboBox>
				
			</h:panelGrid>

			<rich:editor validatorMessage="Dato muy grande"
				value="#{convocatoriaBean.convocatoriaSeleccionada.convocatoria}" id="editor"
				width="460" height="600" theme="advanced"
				plugins="print,contextmenu,paste">
				<f:param name="theme_advanced_buttons1"
					value="save,newdocument,|,bold,italic,underline,strikethrough,|,forecolor,backcolor,|,justifyleft,justifycenter,justifyright,justifyfull"></f:param>
				<f:param name="theme_advanced_buttons2"
					value="styleselect,formatselect,fontselect,fontsizeselect"></f:param>
				<f:param name="theme_advanced_buttons3"
					value="cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview"></f:param>
				<f:param name="theme_advanced_buttons4"
					value="tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen"></f:param>
				<f:param name="theme_advanced_buttons5"
					value="insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage"></f:param>
				<f:param name="theme_advanced_toolbar_location" value="top"></f:param>
				<f:param name="theme_advanced_toolbar_align" value="left"></f:param>
				<f:param name="theme_advanced_statusbar_location" value="bottom"></f:param>
				<f:param name="theme_advanced_resizing" value="true"></f:param>
				<f:validateLength maximum="40480"></f:validateLength>
			</rich:editor>
			<rich:message for="editor" style="color:red;">
				<f:facet name="errorMarker">
					<h:graphicImage value="/images/icons/error.jpg" />
				</f:facet>
			</rich:message>
			<a4j:commandButton value="Aceptar"
				action="#{convocatoriaBean.editarConvocatoria}"
				oncomplete="#{rich:component('wait')}.show()" />
		</h:form>

		<rich:modalPanel id="wait" autosized="true" width="300" height="120"
			moveable="false" style="background-color:white;">
			<f:facet name="header">
				<h:outputText value="Informacion" />
			</f:facet>
			<f:facet name="controls">
				<h:panelGroup>
					<h:graphicImage value="/images/icons/close.jpg" id="hidelink"
						styleClass="hidelink" />
					<rich:componentControl for="wait" attachTo="hidelink"
						operation="hide" event="onclick" />
				</h:panelGroup>
			</f:facet>
			<h:form>
				<h:panelGrid columns="1">
					<a4j:outputPanel ajaxRendered="true">
						<h:panelGroup rendered="#{convocatoriaBean.convocatoriaEditada}">
							<h:panelGrid columns="2">
								<h:graphicImage value="/images/icons/ok.jpg" />
								<h:outputText value="Convocatoria Editada Satisfactoriamente"
									style="font-style: italic; font-size: 16px" />
							</h:panelGrid>
						</h:panelGroup>
					</a4j:outputPanel>
					<a4j:outputPanel ajaxRendered="true">
						<h:panelGroup rendered="#{!convocatoriaBean.convocatoriaEditada}">
							<h:panelGrid columns="2">
								<h:graphicImage value="/images/icons/err.jpg" />
								<h:outputText
									value="Error editando la convocatoria (puede que ya exista una convocatoria activa)"
									style="font-style: italic; font-size: 16px" />
							</h:panelGrid>
						</h:panelGroup>
						<a4j:commandButton value="Aceptar"
						oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('wait')}.hide();"
						reRender="tablaMuni"
						style="width: 100px; height: 30px; font-size: 16px; align: center"></a4j:commandButton>
					</a4j:outputPanel>
				</h:panelGrid>
			</h:form>
		</rich:modalPanel>
	</ui:define>
	<ui:define name="menu">
		<a4j:form>
			<ul class="menu">
				<li class="item174"><h:commandLink value="Atras"
						action="#{convocatoriaBean.obtenerConvocatorias}" /></li>
			</ul>
		</a4j:form>
	</ui:define>
</ui:composition>
</html>